<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var date1 = new Date();//UTC+8
    console.log(date1)
    var t1 = date1.getTime();
    var fc = date1.getTimezoneOffset();
    var diffHUTC = fc/60;
    /*
        北京 14

        格林 22
      */
    var utcT = t1+diffHUTC*3600*1000;//t1+负值，模拟8小时之前的时间
    console.log(utcT)

    var utcTime = new Date(utcT);//模拟的8小时之前的时间
    console.log(utcTime)
    //还原格林时间

    //+8

    var worldUTCConfig = {
        shanghai:8,
        dj:9,
        us:-8
    }
    for(var i in worldUTCConfig){
        var tmp = new Date(utcT + worldUTCConfig[i]*3600*1000);
        console.log(i+':'+tmp);
    }

</script>
</body>
</html>